#-*- coding:utf-8 -*-
# 导入python内置的os模块和sys模块
import os
import sys
import re
#修改从阿里图标库下得到的项目的图标名变换
# 程序入口
if __name__ == "__main__":
    old_names = os.listdir('./')
    # 遍历目录下的文件名
    for old_name in old_names:
        # 跳过本脚本文件
        new_name = re.sub( "iconfont", "zobuild", old_name)
        # 用新的文件名替换旧的文件名
        os.rename(old_name, new_name)
    file_data = ""
    with open('zobuild.css','r') as f1:
        while 1:
            line = f1.readline()
            if not line:
                break
            line = line.replace('iconfont', 'zobuild')
            file_data += line
    with open('zobuild.css', 'w') as f2:
        f2.write(file_data)